/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.ibiz.demo.srv.demo.entity;


import java.io.Serializable;
import java.util.HashMap;
import java.util.ArrayList;

import javax.persistence.Column;

import java.sql.Timestamp;
import net.ibizsys.paas.data.IDataObject;
import net.ibizsys.paas.data.DataObject;
import net.ibizsys.paas.util.StringHelper;
import net.sf.json.JSONObject;
import net.ibizsys.paas.util.JSONObjectHelper;
import net.ibizsys.paas.xml.XmlNode;
import net.ibizsys.paas.service.ServiceGlobal;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


/**
 * 实体[ProjectMembers] 数据对象
 */
public class ProjectMembers extends net.ibizsys.paas.entity.EntityBase implements Serializable {

    private static final long serialVersionUID = -1L;
    private static final Log log = LogFactory.getLog(ProjectMembers.class);
    /**
     *   实体属性标识[建立时间]
     */
    public final static String FIELD_CREATEDATE = "CREATEDATE";
    /**
     *   实体属性标识[建立人]
     */
    public final static String FIELD_CREATEMAN = "CREATEMAN";
    /**
     *   实体属性标识[职工标识]
     */
    public final static String FIELD_EMPLOYEEID = "EMPLOYEEID";
    /**
     *   实体属性标识[职工名称]
     */
    public final static String FIELD_EMPLOYEENAME = "EMPLOYEENAME";
    /**
     *   实体属性标识[项目标识]
     */
    public final static String FIELD_PROJECTID = "PROJECTID";
    /**
     *   实体属性标识[项目成员（关系实体）标识]
     */
    public final static String FIELD_PROJECTMEMBERSID = "PROJECTMEMBERSID";
    /**
     *   实体属性标识[项目成员（关系实体）名称]
     */
    public final static String FIELD_PROJECTMEMBERSNAME = "PROJECTMEMBERSNAME";
    /**
     *   实体属性标识[项目名称]
     */
    public final static String FIELD_PROJECTNAME = "PROJECTNAME";
    /**
     *   实体属性标识[更新时间]
     */
    public final static String FIELD_UPDATEDATE = "UPDATEDATE";
    /**
     *   实体属性标识[更新人]
     */
    public final static String FIELD_UPDATEMAN = "UPDATEMAN";

    private final static int INDEX_CREATEDATE = 0;
    private final static int INDEX_CREATEMAN = 1;
    private final static int INDEX_EMPLOYEEID = 2;
    private final static int INDEX_EMPLOYEENAME = 3;
    private final static int INDEX_PROJECTID = 4;
    private final static int INDEX_PROJECTMEMBERSID = 5;
    private final static int INDEX_PROJECTMEMBERSNAME = 6;
    private final static int INDEX_PROJECTNAME = 7;
    private final static int INDEX_UPDATEDATE = 8;
    private final static int INDEX_UPDATEMAN = 9;

    private final static HashMap<String, Integer> fieldIndexMap = new HashMap<String, Integer>();
    static {
        fieldIndexMap.put( FIELD_CREATEDATE, INDEX_CREATEDATE);
        fieldIndexMap.put( FIELD_CREATEMAN, INDEX_CREATEMAN);
        fieldIndexMap.put( FIELD_EMPLOYEEID, INDEX_EMPLOYEEID);
        fieldIndexMap.put( FIELD_EMPLOYEENAME, INDEX_EMPLOYEENAME);
        fieldIndexMap.put( FIELD_PROJECTID, INDEX_PROJECTID);
        fieldIndexMap.put( FIELD_PROJECTMEMBERSID, INDEX_PROJECTMEMBERSID);
        fieldIndexMap.put( FIELD_PROJECTMEMBERSNAME, INDEX_PROJECTMEMBERSNAME);
        fieldIndexMap.put( FIELD_PROJECTNAME, INDEX_PROJECTNAME);
        fieldIndexMap.put( FIELD_UPDATEDATE, INDEX_UPDATEDATE);
        fieldIndexMap.put( FIELD_UPDATEMAN, INDEX_UPDATEMAN);
    }

    private ProjectMembers proxyProjectMembers = null;

    public ProjectMembers() {
        super();
    }
    private boolean createdateDirtyFlag = false;
    private boolean createmanDirtyFlag = false;
    private boolean employeeidDirtyFlag = false;
    private boolean employeenameDirtyFlag = false;
    private boolean projectidDirtyFlag = false;
    private boolean projectmembersidDirtyFlag = false;
    private boolean projectmembersnameDirtyFlag = false;
    private boolean projectnameDirtyFlag = false;
    private boolean updatedateDirtyFlag = false;
    private boolean updatemanDirtyFlag = false;

    @Column(name="createdate")
    private Timestamp createdate;
    @Column(name="createman")
    private String createman;
    @Column(name="employeeid")
    private String employeeid;
    @Column(name="employeename")
    private String employeename;
    @Column(name="projectid")
    private String projectid;
    @Column(name="projectmembersid")
    private String projectmembersid;
    @Column(name="projectmembersname")
    private String projectmembersname;
    @Column(name="projectname")
    private String projectname;
    @Column(name="updatedate")
    private Timestamp updatedate;
    @Column(name="updateman")
    private String updateman;


    /**
     *  设置属性值[建立时间]
     *  @param createdate
     */
    public void setCreateDate(Timestamp createdate) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setCreateDate(createdate);
            return;
        }
        this.createdate =  createdate;
        this.createdateDirtyFlag  = true;
    }

    /**
     *  获取属性值[建立时间]
     */
    public Timestamp getCreateDate() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getCreateDate();
        }
        return this.createdate;
    }

    /**
     *  获取属性值[建立时间]是否修改
     */
    public boolean isCreateDateDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isCreateDateDirty();
        }
        return this.createdateDirtyFlag;
    }

    /**
     *  重置属性值[建立时间]
     */
    public void resetCreateDate() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetCreateDate();
            return;
        }

        this.createdateDirtyFlag = false;
        this.createdate = null;
    }
    /**
     *  设置属性值[建立人]代码表：com.sa.ibiz.demo.srv.codelist.SysOperatorCodeListModel
     *  @param createman
     */
    public void setCreateMan(String createman) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setCreateMan(createman);
            return;
        }
        if(createman!=null) {
            createman = StringHelper.trimRight(createman);
            if(createman.length()==0) {
                createman = null;
            }
        }
        this.createman =  createman;
        this.createmanDirtyFlag  = true;
    }

    /**
     *  获取属性值[建立人]代码表：com.sa.ibiz.demo.srv.codelist.SysOperatorCodeListModel
     */
    public String getCreateMan() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getCreateMan();
        }
        return this.createman;
    }

    /**
     *  获取属性值[建立人]是否修改
     */
    public boolean isCreateManDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isCreateManDirty();
        }
        return this.createmanDirtyFlag;
    }

    /**
     *  重置属性值[建立人]
     */
    public void resetCreateMan() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetCreateMan();
            return;
        }

        this.createmanDirtyFlag = false;
        this.createman = null;
    }
    /**
     *  设置属性值[职工标识]
     *  @param employeeid
     */
    public void setEmployeeId(String employeeid) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setEmployeeId(employeeid);
            return;
        }
        if(employeeid!=null) {
            employeeid = StringHelper.trimRight(employeeid);
            if(employeeid.length()==0) {
                employeeid = null;
            }
        }
        this.employeeid =  employeeid;
        this.employeeidDirtyFlag  = true;
    }

    /**
     *  获取属性值[职工标识]
     */
    public String getEmployeeId() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getEmployeeId();
        }
        return this.employeeid;
    }

    /**
     *  获取属性值[职工标识]是否修改
     */
    public boolean isEmployeeIdDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isEmployeeIdDirty();
        }
        return this.employeeidDirtyFlag;
    }

    /**
     *  重置属性值[职工标识]
     */
    public void resetEmployeeId() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetEmployeeId();
            return;
        }

        this.employeeidDirtyFlag = false;
        this.employeeid = null;
    }
    /**
     *  设置属性值[职工名称]
     *  @param employeename
     */
    public void setEmployeeName(String employeename) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setEmployeeName(employeename);
            return;
        }
        if(employeename!=null) {
            employeename = StringHelper.trimRight(employeename);
            if(employeename.length()==0) {
                employeename = null;
            }
        }
        this.employeename =  employeename;
        this.employeenameDirtyFlag  = true;
    }

    /**
     *  获取属性值[职工名称]
     */
    public String getEmployeeName() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getEmployeeName();
        }
        return this.employeename;
    }

    /**
     *  获取属性值[职工名称]是否修改
     */
    public boolean isEmployeeNameDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isEmployeeNameDirty();
        }
        return this.employeenameDirtyFlag;
    }

    /**
     *  重置属性值[职工名称]
     */
    public void resetEmployeeName() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetEmployeeName();
            return;
        }

        this.employeenameDirtyFlag = false;
        this.employeename = null;
    }
    /**
     *  设置属性值[项目标识]
     *  @param projectid
     */
    public void setProjectId(String projectid) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setProjectId(projectid);
            return;
        }
        if(projectid!=null) {
            projectid = StringHelper.trimRight(projectid);
            if(projectid.length()==0) {
                projectid = null;
            }
        }
        this.projectid =  projectid;
        this.projectidDirtyFlag  = true;
    }

    /**
     *  获取属性值[项目标识]
     */
    public String getProjectId() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getProjectId();
        }
        return this.projectid;
    }

    /**
     *  获取属性值[项目标识]是否修改
     */
    public boolean isProjectIdDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isProjectIdDirty();
        }
        return this.projectidDirtyFlag;
    }

    /**
     *  重置属性值[项目标识]
     */
    public void resetProjectId() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetProjectId();
            return;
        }

        this.projectidDirtyFlag = false;
        this.projectid = null;
    }
    /**
     *  设置属性值[项目成员（关系实体）标识]
     *  @param projectmembersid
     */
    public void setProjectMembersId(String projectmembersid) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setProjectMembersId(projectmembersid);
            return;
        }
        if(projectmembersid!=null) {
            projectmembersid = StringHelper.trimRight(projectmembersid);
            if(projectmembersid.length()==0) {
                projectmembersid = null;
            }
        }
        this.projectmembersid =  projectmembersid;
        this.projectmembersidDirtyFlag  = true;
    }

    /**
     *  获取属性值[项目成员（关系实体）标识]
     */
    public String getProjectMembersId() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getProjectMembersId();
        }
        return this.projectmembersid;
    }

    /**
     *  获取属性值[项目成员（关系实体）标识]是否修改
     */
    public boolean isProjectMembersIdDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isProjectMembersIdDirty();
        }
        return this.projectmembersidDirtyFlag;
    }

    /**
     *  重置属性值[项目成员（关系实体）标识]
     */
    public void resetProjectMembersId() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetProjectMembersId();
            return;
        }

        this.projectmembersidDirtyFlag = false;
        this.projectmembersid = null;
    }
    /**
     *  设置属性值[项目成员（关系实体）名称]
     *  @param projectmembersname
     */
    public void setProjectMembersName(String projectmembersname) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setProjectMembersName(projectmembersname);
            return;
        }
        if(projectmembersname!=null) {
            projectmembersname = StringHelper.trimRight(projectmembersname);
            if(projectmembersname.length()==0) {
                projectmembersname = null;
            }
        }
        this.projectmembersname =  projectmembersname;
        this.projectmembersnameDirtyFlag  = true;
    }

    /**
     *  获取属性值[项目成员（关系实体）名称]
     */
    public String getProjectMembersName() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getProjectMembersName();
        }
        return this.projectmembersname;
    }

    /**
     *  获取属性值[项目成员（关系实体）名称]是否修改
     */
    public boolean isProjectMembersNameDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isProjectMembersNameDirty();
        }
        return this.projectmembersnameDirtyFlag;
    }

    /**
     *  重置属性值[项目成员（关系实体）名称]
     */
    public void resetProjectMembersName() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetProjectMembersName();
            return;
        }

        this.projectmembersnameDirtyFlag = false;
        this.projectmembersname = null;
    }
    /**
     *  设置属性值[项目名称]
     *  @param projectname
     */
    public void setProjectName(String projectname) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setProjectName(projectname);
            return;
        }
        if(projectname!=null) {
            projectname = StringHelper.trimRight(projectname);
            if(projectname.length()==0) {
                projectname = null;
            }
        }
        this.projectname =  projectname;
        this.projectnameDirtyFlag  = true;
    }

    /**
     *  获取属性值[项目名称]
     */
    public String getProjectName() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getProjectName();
        }
        return this.projectname;
    }

    /**
     *  获取属性值[项目名称]是否修改
     */
    public boolean isProjectNameDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isProjectNameDirty();
        }
        return this.projectnameDirtyFlag;
    }

    /**
     *  重置属性值[项目名称]
     */
    public void resetProjectName() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetProjectName();
            return;
        }

        this.projectnameDirtyFlag = false;
        this.projectname = null;
    }
    /**
     *  设置属性值[更新时间]
     *  @param updatedate
     */
    public void setUpdateDate(Timestamp updatedate) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setUpdateDate(updatedate);
            return;
        }
        this.updatedate =  updatedate;
        this.updatedateDirtyFlag  = true;
    }

    /**
     *  获取属性值[更新时间]
     */
    public Timestamp getUpdateDate() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getUpdateDate();
        }
        return this.updatedate;
    }

    /**
     *  获取属性值[更新时间]是否修改
     */
    public boolean isUpdateDateDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isUpdateDateDirty();
        }
        return this.updatedateDirtyFlag;
    }

    /**
     *  重置属性值[更新时间]
     */
    public void resetUpdateDate() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetUpdateDate();
            return;
        }

        this.updatedateDirtyFlag = false;
        this.updatedate = null;
    }
    /**
     *  设置属性值[更新人]代码表：com.sa.ibiz.demo.srv.codelist.SysOperatorCodeListModel
     *  @param updateman
     */
    public void setUpdateMan(String updateman) {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().setUpdateMan(updateman);
            return;
        }
        if(updateman!=null) {
            updateman = StringHelper.trimRight(updateman);
            if(updateman.length()==0) {
                updateman = null;
            }
        }
        this.updateman =  updateman;
        this.updatemanDirtyFlag  = true;
    }

    /**
     *  获取属性值[更新人]代码表：com.sa.ibiz.demo.srv.codelist.SysOperatorCodeListModel
     */
    public String getUpdateMan() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getUpdateMan();
        }
        return this.updateman;
    }

    /**
     *  获取属性值[更新人]是否修改
     */
    public boolean isUpdateManDirty() {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isUpdateManDirty();
        }
        return this.updatemanDirtyFlag;
    }

    /**
     *  重置属性值[更新人]
     */
    public void resetUpdateMan() {

        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().resetUpdateMan();
            return;
        }

        this.updatemanDirtyFlag = false;
        this.updateman = null;
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.entity.EntityBase#onReset()
     */
    @Override
    protected void onReset() {
        ProjectMembers.resetAll(this);
        super.onReset();
    }

    /**
     * 重置当前数据对象属性值
     * @param entity
     */
    private static void resetAll(ProjectMembers et) {
        et.resetCreateDate();
        et.resetCreateMan();
        et.resetEmployeeId();
        et.resetEmployeeName();
        et.resetProjectId();
        et.resetProjectMembersId();
        et.resetProjectMembersName();
        et.resetProjectName();
        et.resetUpdateDate();
        et.resetUpdateMan();
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.entity.EntityBase#onFillMap(java.util.HashMap, boolean)
     */
    @Override
    protected void onFillMap(HashMap<String, Object> params, boolean bDirtyOnly) {
        if(!bDirtyOnly || isCreateDateDirty()) {
            params.put(FIELD_CREATEDATE,getCreateDate());
        }
        if(!bDirtyOnly || isCreateManDirty()) {
            params.put(FIELD_CREATEMAN,getCreateMan());
        }
        if(!bDirtyOnly || isEmployeeIdDirty()) {
            params.put(FIELD_EMPLOYEEID,getEmployeeId());
        }
        if(!bDirtyOnly || isEmployeeNameDirty()) {
            params.put(FIELD_EMPLOYEENAME,getEmployeeName());
        }
        if(!bDirtyOnly || isProjectIdDirty()) {
            params.put(FIELD_PROJECTID,getProjectId());
        }
        if(!bDirtyOnly || isProjectMembersIdDirty()) {
            params.put(FIELD_PROJECTMEMBERSID,getProjectMembersId());
        }
        if(!bDirtyOnly || isProjectMembersNameDirty()) {
            params.put(FIELD_PROJECTMEMBERSNAME,getProjectMembersName());
        }
        if(!bDirtyOnly || isProjectNameDirty()) {
            params.put(FIELD_PROJECTNAME,getProjectName());
        }
        if(!bDirtyOnly || isUpdateDateDirty()) {
            params.put(FIELD_UPDATEDATE,getUpdateDate());
        }
        if(!bDirtyOnly || isUpdateManDirty()) {
            params.put(FIELD_UPDATEMAN,getUpdateMan());
        }
        super.onFillMap(params, bDirtyOnly);
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#get(java.lang.String)
     */
    @Override
    public Object get(String strParamName) throws Exception {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().get(strParamName);
        }

        if(StringHelper.isNullOrEmpty(strParamName))
            throw new Exception("没有指定属性");
        Integer index=fieldIndexMap.get(strParamName.toUpperCase());
        if(index==null)
            return super.get(strParamName);

        return  ProjectMembers.get(this, index);
    }

    /**
     * 通过属性标识获取属性值
     * @param et 数据对象
     * @param index 属性标识
     * @return
     * @throws Exception
     */
    private static Object get(ProjectMembers et,int index) throws Exception {

        switch(index) {
        case INDEX_CREATEDATE:
            return et.getCreateDate();
        case INDEX_CREATEMAN:
            return et.getCreateMan();
        case INDEX_EMPLOYEEID:
            return et.getEmployeeId();
        case INDEX_EMPLOYEENAME:
            return et.getEmployeeName();
        case INDEX_PROJECTID:
            return et.getProjectId();
        case INDEX_PROJECTMEMBERSID:
            return et.getProjectMembersId();
        case INDEX_PROJECTMEMBERSNAME:
            return et.getProjectMembersName();
        case INDEX_PROJECTNAME:
            return et.getProjectName();
        case INDEX_UPDATEDATE:
            return et.getUpdateDate();
        case INDEX_UPDATEMAN:
            return et.getUpdateMan();
        default:
            throw new Exception("不明属性标识");
        }
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#set(java.lang.String, java.lang.Object)
     */
    @Override
    public void set(String strParamName,Object objValue) throws Exception {
        if(this.getProxyEntity()!=null) {
            this.getProxyEntity().set(strParamName,objValue);
            return;
        }
        if(StringHelper.isNullOrEmpty(strParamName))
            throw new Exception("没有指定属性");

        Integer index=fieldIndexMap.get(strParamName.toUpperCase());
        if(index==null) {
            super.set(strParamName,objValue);
            return;
        }

        ProjectMembers.set(this,index,objValue);
    }

    /**
     * 通过属性标识设定属性值
     * @param et 数据对象
     * @param index 属性标识
     * @param obj 值
     * @throws Exception
     */
    private static void set(ProjectMembers et,int index,Object obj) throws Exception {
        switch(index) {
        case INDEX_CREATEDATE:
            et.setCreateDate(DataObject.getTimestampValue(obj));
            return ;
        case INDEX_CREATEMAN:
            et.setCreateMan(DataObject.getStringValue(obj));
            return ;
        case INDEX_EMPLOYEEID:
            et.setEmployeeId(DataObject.getStringValue(obj));
            return ;
        case INDEX_EMPLOYEENAME:
            et.setEmployeeName(DataObject.getStringValue(obj));
            return ;
        case INDEX_PROJECTID:
            et.setProjectId(DataObject.getStringValue(obj));
            return ;
        case INDEX_PROJECTMEMBERSID:
            et.setProjectMembersId(DataObject.getStringValue(obj));
            return ;
        case INDEX_PROJECTMEMBERSNAME:
            et.setProjectMembersName(DataObject.getStringValue(obj));
            return ;
        case INDEX_PROJECTNAME:
            et.setProjectName(DataObject.getStringValue(obj));
            return ;
        case INDEX_UPDATEDATE:
            et.setUpdateDate(DataObject.getTimestampValue(obj));
            return ;
        case INDEX_UPDATEMAN:
            et.setUpdateMan(DataObject.getStringValue(obj));
            return ;
        default:
            throw new Exception("不明属性标识");
        }
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#isNull(java.lang.String)
     */
    @Override
    public boolean isNull(String strParamName) throws Exception {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().isNull(strParamName);
        }
        if(StringHelper.isNullOrEmpty(strParamName))
            throw new Exception("没有指定属性");

        Integer index=fieldIndexMap.get(strParamName.toUpperCase());
        if(index==null)
            return super.isNull(strParamName);

        return  ProjectMembers.isNull(this, index);
    }

    /**
     * 判断指定属性值是否为空值
     * @param et
     * @param index
     * @return
     * @throws Exception
     */
    private static boolean isNull(ProjectMembers et,int index) throws Exception {

        switch(index) {
        case INDEX_CREATEDATE:
            return et.getCreateDate()==null;
        case INDEX_CREATEMAN:
            return et.getCreateMan()==null;
        case INDEX_EMPLOYEEID:
            return et.getEmployeeId()==null;
        case INDEX_EMPLOYEENAME:
            return et.getEmployeeName()==null;
        case INDEX_PROJECTID:
            return et.getProjectId()==null;
        case INDEX_PROJECTMEMBERSID:
            return et.getProjectMembersId()==null;
        case INDEX_PROJECTMEMBERSNAME:
            return et.getProjectMembersName()==null;
        case INDEX_PROJECTNAME:
            return et.getProjectName()==null;
        case INDEX_UPDATEDATE:
            return et.getUpdateDate()==null;
        case INDEX_UPDATEMAN:
            return et.getUpdateMan()==null;
        default:
            throw new Exception("不明属性标识");
        }
    }


    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#contains(java.lang.String)
     */
    @Override
    public boolean contains(String strParamName) throws Exception {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().contains(strParamName);
        }

        if(StringHelper.isNullOrEmpty(strParamName))
            throw new Exception("没有指定属性");
        Integer index=fieldIndexMap.get(strParamName.toUpperCase());
        if(index==null)
            return super.contains(strParamName);

        return  ProjectMembers.contains(this, index);
    }

    /**
     * 获取判断对象是否存在指定属性值
     * @param et
     * @param index
     * @return
     * @throws Exception
     */
    private static boolean contains(ProjectMembers et,int index) throws Exception {

        switch(index) {
        case INDEX_CREATEDATE:
            return et.isCreateDateDirty();
        case INDEX_CREATEMAN:
            return et.isCreateManDirty();
        case INDEX_EMPLOYEEID:
            return et.isEmployeeIdDirty();
        case INDEX_EMPLOYEENAME:
            return et.isEmployeeNameDirty();
        case INDEX_PROJECTID:
            return et.isProjectIdDirty();
        case INDEX_PROJECTMEMBERSID:
            return et.isProjectMembersIdDirty();
        case INDEX_PROJECTMEMBERSNAME:
            return et.isProjectMembersNameDirty();
        case INDEX_PROJECTNAME:
            return et.isProjectNameDirty();
        case INDEX_UPDATEDATE:
            return et.isUpdateDateDirty();
        case INDEX_UPDATEMAN:
            return et.isUpdateManDirty();
        default:
            throw new Exception("不明属性标识");
        }
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#onFillJSONObject(net.sf.json.JSONObject, boolean)
     */
    @Override
    protected void onFillJSONObject(JSONObject objJSON, boolean bIncludeEmpty) throws Exception {
        fillJSONObject(this,objJSON,bIncludeEmpty);
        super.onFillJSONObject(objJSON, bIncludeEmpty);
    }

    /**
     * 填充当前对象到JSON
     * @param et 当前数据对象
     * @param json JSON对象
     * @param bIncEmpty 是否包括空值
     * @throws Exception
     */
    private static  void fillJSONObject(ProjectMembers et,JSONObject json, boolean bIncEmpty) throws Exception {
        if(bIncEmpty||et.getCreateDate()!=null) {
            JSONObjectHelper.put(json,"createdate",getJSONValue(et.getCreateDate()),false);
        }
        if(bIncEmpty||et.getCreateMan()!=null) {
            JSONObjectHelper.put(json,"createman",getJSONValue(et.getCreateMan()),false);
        }
        if(bIncEmpty||et.getEmployeeId()!=null) {
            JSONObjectHelper.put(json,"employeeid",getJSONValue(et.getEmployeeId()),false);
        }
        if(bIncEmpty||et.getEmployeeName()!=null) {
            JSONObjectHelper.put(json,"employeename",getJSONValue(et.getEmployeeName()),false);
        }
        if(bIncEmpty||et.getProjectId()!=null) {
            JSONObjectHelper.put(json,"projectid",getJSONValue(et.getProjectId()),false);
        }
        if(bIncEmpty||et.getProjectMembersId()!=null) {
            JSONObjectHelper.put(json,"projectmembersid",getJSONValue(et.getProjectMembersId()),false);
        }
        if(bIncEmpty||et.getProjectMembersName()!=null) {
            JSONObjectHelper.put(json,"projectmembersname",getJSONValue(et.getProjectMembersName()),false);
        }
        if(bIncEmpty||et.getProjectName()!=null) {
            JSONObjectHelper.put(json,"projectname",getJSONValue(et.getProjectName()),false);
        }
        if(bIncEmpty||et.getUpdateDate()!=null) {
            JSONObjectHelper.put(json,"updatedate",getJSONValue(et.getUpdateDate()),false);
        }
        if(bIncEmpty||et.getUpdateMan()!=null) {
            JSONObjectHelper.put(json,"updateman",getJSONValue(et.getUpdateMan()),false);
        }
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#onFillXmlNode(net.ibizsys.paas.xml.XmlNode, boolean)
     */
    @Override
    protected void onFillXmlNode(XmlNode xmlNode,boolean bIncludeEmpty) throws Exception {
        fillXmlNode(this,xmlNode,bIncludeEmpty);
        super.onFillXmlNode(xmlNode, bIncludeEmpty);
    }

    /**
     * 填充当前对象到Xml节点中
     * @param et 当前数据对象
     * @param node Xml节点
     * @param bIncEmpty 是否包括空值
     * @throws Exception
     */
    private static void fillXmlNode(ProjectMembers et,XmlNode node,boolean bIncEmpty) throws Exception {
        if(bIncEmpty||et.getCreateDate()!=null) {
            Object obj = et.getCreateDate();
            node.setAttribute("CREATEDATE",(obj==null)?"":StringHelper.format("%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS",obj));
        }
        if(bIncEmpty||et.getCreateMan()!=null) {
            Object obj = et.getCreateMan();
            node.setAttribute("CREATEMAN",(obj==null)?"":(String)obj);
        }
        if(bIncEmpty||et.getEmployeeId()!=null) {
            Object obj = et.getEmployeeId();
            node.setAttribute("EMPLOYEEID",(obj==null)?"":(String)obj);
        }
        if(bIncEmpty||et.getEmployeeName()!=null) {
            Object obj = et.getEmployeeName();
            node.setAttribute("EMPLOYEENAME",(obj==null)?"":(String)obj);
        }
        if(bIncEmpty||et.getProjectId()!=null) {
            Object obj = et.getProjectId();
            node.setAttribute("PROJECTID",(obj==null)?"":(String)obj);
        }
        if(bIncEmpty||et.getProjectMembersId()!=null) {
            Object obj = et.getProjectMembersId();
            node.setAttribute("PROJECTMEMBERSID",(obj==null)?"":(String)obj);
        }
        if(bIncEmpty||et.getProjectMembersName()!=null) {
            Object obj = et.getProjectMembersName();
            node.setAttribute("PROJECTMEMBERSNAME",(obj==null)?"":(String)obj);
        }
        if(bIncEmpty||et.getProjectName()!=null) {
            Object obj = et.getProjectName();
            node.setAttribute("PROJECTNAME",(obj==null)?"":(String)obj);
        }
        if(bIncEmpty||et.getUpdateDate()!=null) {
            Object obj = et.getUpdateDate();
            node.setAttribute("UPDATEDATE",(obj==null)?"":StringHelper.format("%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS",obj));
        }
        if(bIncEmpty||et.getUpdateMan()!=null) {
            Object obj = et.getUpdateMan();
            node.setAttribute("UPDATEMAN",(obj==null)?"":(String)obj);
        }


    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.entity.EntityBase#onCopyTo(net.ibizsys.paas.data.IDataObject, boolean)
     */
    @Override
    protected void onCopyTo(IDataObject dataEntity, boolean bIncludeEmtpy) throws Exception {
        ProjectMembers.copyTo(this,dataEntity,bIncludeEmtpy);
        super.onCopyTo(dataEntity,bIncludeEmtpy);
    }

    /**
     * 复制当前对象数据到目标对象
     * @param et 当前数据对象
     * @param dst 目标数据对象
     * @param bIncEmpty 是否包括空值
     * @throws Exception
     */
    private static void copyTo(ProjectMembers et,IDataObject dst,boolean bIncEmpty) throws Exception {
        if(et.isCreateDateDirty() && (bIncEmpty||et.getCreateDate()!=null)) {
            dst.set(FIELD_CREATEDATE,et.getCreateDate());
        }
        if(et.isCreateManDirty() && (bIncEmpty||et.getCreateMan()!=null)) {
            dst.set(FIELD_CREATEMAN,et.getCreateMan());
        }
        if(et.isEmployeeIdDirty() && (bIncEmpty||et.getEmployeeId()!=null)) {
            dst.set(FIELD_EMPLOYEEID,et.getEmployeeId());
        }
        if(et.isEmployeeNameDirty() && (bIncEmpty||et.getEmployeeName()!=null)) {
            dst.set(FIELD_EMPLOYEENAME,et.getEmployeeName());
        }
        if(et.isProjectIdDirty() && (bIncEmpty||et.getProjectId()!=null)) {
            dst.set(FIELD_PROJECTID,et.getProjectId());
        }
        if(et.isProjectMembersIdDirty() && (bIncEmpty||et.getProjectMembersId()!=null)) {
            dst.set(FIELD_PROJECTMEMBERSID,et.getProjectMembersId());
        }
        if(et.isProjectMembersNameDirty() && (bIncEmpty||et.getProjectMembersName()!=null)) {
            dst.set(FIELD_PROJECTMEMBERSNAME,et.getProjectMembersName());
        }
        if(et.isProjectNameDirty() && (bIncEmpty||et.getProjectName()!=null)) {
            dst.set(FIELD_PROJECTNAME,et.getProjectName());
        }
        if(et.isUpdateDateDirty() && (bIncEmpty||et.getUpdateDate()!=null)) {
            dst.set(FIELD_UPDATEDATE,et.getUpdateDate());
        }
        if(et.isUpdateManDirty() && (bIncEmpty||et.getUpdateMan()!=null)) {
            dst.set(FIELD_UPDATEMAN,et.getUpdateMan());
        }
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#remove(java.lang.String)
     */
    @Override
    public boolean remove(String strParamName) throws Exception {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().remove(strParamName);
        }

        if(StringHelper.isNullOrEmpty(strParamName))
            throw new Exception("没有指定属性");
        Integer index=fieldIndexMap.get(strParamName.toUpperCase());
        if(index==null)
            return super.remove(strParamName);
        return  ProjectMembers.remove(this, index);
    }

    /**
     * 通过属性标识删除属性值
     * @param entity
     * @param index
     * @return
     * @throws Exception
     */
    private static boolean remove(ProjectMembers et,int index) throws Exception {
        switch(index) {
        case INDEX_CREATEDATE:
            et.resetCreateDate();
            return true;
        case INDEX_CREATEMAN:
            et.resetCreateMan();
            return true;
        case INDEX_EMPLOYEEID:
            et.resetEmployeeId();
            return true;
        case INDEX_EMPLOYEENAME:
            et.resetEmployeeName();
            return true;
        case INDEX_PROJECTID:
            et.resetProjectId();
            return true;
        case INDEX_PROJECTMEMBERSID:
            et.resetProjectMembersId();
            return true;
        case INDEX_PROJECTMEMBERSNAME:
            et.resetProjectMembersName();
            return true;
        case INDEX_PROJECTNAME:
            et.resetProjectName();
            return true;
        case INDEX_UPDATEDATE:
            et.resetUpdateDate();
            return true;
        case INDEX_UPDATEMAN:
            et.resetUpdateMan();
            return true;
        default:
            throw new Exception("不明属性标识");
        }
    }


    private Object objPROJECTLock = new Object();
    private com.sa.ibiz.demo.srv.demo.entity.Project project = null;
    /**
    * 获取父数据 项目
     * @throws Exception
    */
    public com.sa.ibiz.demo.srv.demo.entity.Project getPROJECT() throws Exception {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getPROJECT();
        }

        if(this.getProjectId()==null)
            return null;
        synchronized(objPROJECTLock) {
            if(project==null) {
                project = new com.sa.ibiz.demo.srv.demo.entity.Project();
                project.setProjectId(this.getProjectId());
                com.sa.ibiz.demo.srv.demo.service.ProjectService service = (com.sa.ibiz.demo.srv.demo.service.ProjectService)ServiceGlobal.getService(com.sa.ibiz.demo.srv.demo.service.ProjectService.class,this.getSessionFactory());
                if(this.getProjectId().indexOf(net.ibizsys.paas.service.ServiceBase.TEMPKEY) == 0)
                    service.getTemp(project);
                else
                    service.get(project);
            }
            return project;
        }
    }

    private Object objEMPLOYEELock = new Object();
    private com.sa.ibiz.demo.srv.demo.entity.Employee employee = null;
    /**
    * 获取父数据 职工
     * @throws Exception
    */
    public com.sa.ibiz.demo.srv.demo.entity.Employee getEMPLOYEE() throws Exception {
        if(this.getProxyEntity()!=null) {
            return this.getProxyEntity().getEMPLOYEE();
        }

        if(this.getEmployeeId()==null)
            return null;
        synchronized(objEMPLOYEELock) {
            if(employee==null) {
                employee = new com.sa.ibiz.demo.srv.demo.entity.Employee();
                employee.setEmployeeId(this.getEmployeeId());
                com.sa.ibiz.demo.srv.demo.service.EmployeeService service = (com.sa.ibiz.demo.srv.demo.service.EmployeeService)ServiceGlobal.getService(com.sa.ibiz.demo.srv.demo.service.EmployeeService.class,this.getSessionFactory());
                if(this.getEmployeeId().indexOf(net.ibizsys.paas.service.ServiceBase.TEMPKEY) == 0)
                    service.getTemp(employee);
                else
                    service.get(employee);
            }
            return employee;
        }
    }





    /**
     *  获取代理的数据对象
     */
    private ProjectMembers getProxyEntity() {
        return this.proxyProjectMembers;
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.data.DataObject#onProxy(net.ibizsys.paas.data.IDataObject)
     */
    @Override
    protected void onProxy(IDataObject proxyDataObject) {
        this.proxyProjectMembers = null;
        if(proxyDataObject!=null && proxyDataObject instanceof ProjectMembers) {
            this.proxyProjectMembers = (ProjectMembers)proxyDataObject;
        }

    }

}